package com.itheima.homework.Two;

public class Student implements Comparable<Student>{

    @Override
    public int compareTo(Student o) {
        int grade1 =  this.getChi()+this.getEng()+this.getMath();
        int grade2 =  o.getChi()+o.getEng()+o.getMath();
        int i = grade1 - grade2;
        return i;
    }


    private String name;
    private int chi;
    private int math;
    private int eng;


    public Student() {
    }

    public Student(String name, int chi, int math, int eng) {
        this.name = name;
        this.chi = chi;
        this.math = math;
        this.eng = eng;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getChi() {
        return chi;
    }

    public void setChi(int chi) {
        this.chi = chi;
    }

    public int getMath() {
        return math;
    }

    public void setMath(int math) {
        this.math = math;
    }

    public int getEng() {
        return eng;
    }

    public void setEng(int eng) {
        this.eng = eng;
    }

    @Override
    public String toString() {
        return "zongchengji"+chi+eng+math;
    }


}
